#pragma once 

#include <iostream>
#include <unistd.h>
#include <fcntl.h>

class Util
{
public:
    static void setNonBlock(int sock)   //将套接字设为非阻塞
    {
        int fl=fcntl(sock,F_GETFL);
        if(fl<0) return;
        fcntl(sock,F_SETFL,fl|O_NONBLOCK);
        std::cout<<sock<<"非阻塞"<<std::endl;
    }


};